<%-- 
    Document   : view_anggota
    Created on : Jan 13, 2014, 3:08:22 AM
    Author     : Muhammad Dony
--%>
<%@page import="java.util.List"%>
<%@page import="data.UserData"%>
<%@page import="database.UserDB"%>
<%@include file="../Admin/header_admin.jsp" %>
<% //userdata user = (userdata) session.getAttribute("adminMasuk"); %>
<script src="res/js/jquery.dataTables.js"></script>
<script src="res/js/bootstrap.dataTables.js"></script>
<link href="res/css/dataTables.css" type="text/css"/>
<style>.pagination{margin:0}</style>
<div class="row">
    <div class="col-lg-6 col-lg-push-1">
        <a href="./TambahAnggota?action=add" class="btn btn-success"><i class="glyphicon glyphicon-plus"></i> Tambah Anggota</a>
        <table id="table" cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered">
            <thead>
            <tbody>
            <th>No</th>
            <th>ID</th>
            <th>First Name</th>
            <th>Last Name</th>
            <th>Email</th>
            </thead>
            <tbody>
                <%
                    List listdata = (List) request.getAttribute("listdata");
                    int n = 1;
                %>
                <% for (int i = 0; i < listdata.size(); i++) {
                        UserData data = (UserData) listdata.get(i);%>
                <tr>
                    <td><%=n++%></td>
                    <td><%=data.getID()%></td>
                    <td><%=data.getFirstname()%></td>
                    <td></i><%=data.getLastname()%></td>
                    <td></i><%=data.getEmail()%></td>
                    <td>
                        <a href="./TambahAnggota?action=edit&id=<%=data.getID()%>" class="btn btn-primary">
                            <i class="glyphicon glyphicon-pencil"></i> Edit
                        </a> 
                        <a href="./TambahAnggota?action=delete&id=<%=data.getID()%>" class="btn btn-danger">
                            <i class="glyphicon glyphicon-trash"></i> Delete
                        </a>
                    </td>  
                </tr>
                <% }%>
            </tbody>
        </table>
    </div>
</div>
<%@include file="../Admin/footer_admin.jsp" %>